<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilsecure: xilsecure_versal_ecdsa_client_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilsecure
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xilsecure__versal__ecdsa__client__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xilsecure_versal_ecdsa_client_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This example tests the Xilsecure client elliptic APIs. </p>
<p>NOTE: By default this example is created with data in LITTLE endian format, If user changes the XilSecure BSP xsecure_elliptic_endianness configuration to BIG endian, data buffers shall be created in BIG endian format. Also, this configuration is valid only over Server BSP, client side has no impact.</p>
<p>To build this application, xilmailbox library must be included in BSP and xilsecure must be in client mode This example is supported for Versal and Versal Net devices. Irrespective of endianness, outputs will result in Big Endian format.</p>
<dl class="section note"><dt>Note</dt><dd><h2>Procedure to link and compile the example for the default ddr less designs </h2>
</dd></dl>
<p>The default linker settings places a software stack, heap and data in DDR memory. For this example to work, any data shared between client running on A72/R5/PL and server running on PMC, should be placed in area which is accessible to both client and server.</p>
<p>Following is the procedure to compile the example on OCM or any memory region which can be accessed by server </p>
<pre class="fragment">    1. Open example linker script(lscript.ld) in Vitis project and section to memory mapping should
            be updated to point all the required sections to shared memory(OCM or TCM)
            using a memory region drop down selection

                                    OR

    1. In linker script(lscript.ld) user can add new memory section in source tab as shown below
            .sharedmemory : {
                    . = ALIGN(4);
                    __sharedmemory_start = .;
                    *(.sharedmemory)
                    *(.sharedmemory.*)
                    *(.gnu.linkonce.d.*)
                    __sharedmemory_end = .;
                    } &gt; versal_cips_0_pspmc_0_psv_ocm_ram_0_psv_ocm_ram_0

            2. In this example ".data" section elements that are passed by reference to the server-side should
               be stored in the above shared memory section. To make it happen in below example,
       replace ".data" in attribute section with ".sharedmemory". For example,
               static const u8 Hash_P384[] __attribute__ ((section (".data.Hash_P384")))
                                    should be changed to
               static const u8 Hash_P384[] __attribute__ ((section (".sharedmemory.Hash_P384")))
</pre><p>To keep things simple, by default the cache is disabled for this example Maximum supported Hash length for each curve is same as the curve size.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date        Changes
----- ---- ---------- -------------------------------------------------------
1.0   har  08/24/2020 Initial release
4.3   har  08/24/2020 Updated file version to sync with library version
4.5   kal  03/23/2021 Updated file for client support.
      har  06/02/2021 Fixed GCC warnings for R5 compiler
4.7   kpt  01/13/2022 Added support for PL microblaze
      kpt  03/16/2022 Removed IPI related code and added mailbox support
      kpt  04/11/2022 Added comment on usage of shared memory
5.2   am   05/03/2023 Added KAT before crypto usage
      yog  06/07/2023 Added support for P-256 Curve
      yog  07/28/2023 Added support to handle endianness
      am   08/18/2023 Updated Hash size to 48bytes for P521 curve
5.4   mb   04/13/2024 Added support for P-192 Curve
      mb   04/13/2024 Added support for P-224 Curve
      mb   07/05/2024 Ported all curves test API's into single generic API.
      pre  08/29/24 Added SSIT support</pre><pre></pre><dl class="section note"><dt>Note</dt><dd></dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xilsecure__versal__ecdsa__client__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call the XSecure_TestP384, XSecure_TestP521 and XSecure_TestP256.  <a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br/></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call the XSecure_TestP384, XSecure_TestP521 and XSecure_TestP256. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_FAILURE if the ecdsa failed. </li>
</ul>
</dd></dl>

<p>References <a class="el" href="group__xsecure__mailbox__apis.html#ga14ac66445aa924c4c0bd9b91b9744af9">XSecure_ClientInit()</a>, <a class="el" href="group__xsecure__common__apis.html#gga7aecdb57be4a4242f11ad3e3bebb42e6a56563085e91b2916d8b2597aa5b0518c">XSECURE_ECC_NIST_P192</a>, <a class="el" href="group__xsecure__common__apis.html#gga7aecdb57be4a4242f11ad3e3bebb42e6ada7c82dece1225d698e071b37a709a7b">XSECURE_ECC_NIST_P224</a>, <a class="el" href="group__xsecure__common__apis.html#gga7aecdb57be4a4242f11ad3e3bebb42e6a4887100b873751c7ab11f3c25971da31">XSECURE_ECC_NIST_P256</a>, <a class="el" href="group__xsecure__common__apis.html#gga7aecdb57be4a4242f11ad3e3bebb42e6a96b467bb47305585cbcb31f93d527407">XSECURE_ECC_NIST_P384</a>, <a class="el" href="group__xsecure__common__apis.html#gga7aecdb57be4a4242f11ad3e3bebb42e6a1ac6872da48c5879c457fb9e0590c36b">XSECURE_ECC_NIST_P521</a>, <a class="el" href="group__xsecure__common__apis.html#gab6ed5940007e9e540194a96151767137">XSECURE_ECDSA_PRIME</a>, <a class="el" href="group__xsecure__kat__client__apis.html#ga5e9df7a4b6b28b1827cf11be03a97e0d">XSecure_EllipticSignGenKat()</a>, and <a class="el" href="group__xsecure__kat__client__apis.html#gaf5996378299f1f95c9a13592febad58a">XSecure_EllipticSignVerifyKat()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
